import com.yh.dao.UserMapper;
import com.yh.entity.User;
import com.yh.services.IUserService;
import com.yh.services.impl.UserServiceImpl;
import com.yh.util.SqlSessionFactoryUtil;
import org.apache.ibatis.session.SqlSession;
import org.junit.Test;

import java.util.List;

public class Demo {
    SqlSession sqlSession= SqlSessionFactoryUtil.getSqlSession();
    UserMapper mapper = sqlSession.getMapper(UserMapper.class);


    @Test
    public void test01(){
        IUserService userService= new UserServiceImpl();
        User u=new User();
        u.setCol_Name("admin");
        u.setCol_Pwd("admin");
       User user=userService.login(u);
        System.out.println(user.getCol_Name());
    }


    @Test
    public void test02(){
        IUserService iUserService=new UserServiceImpl();
        List<User> users=iUserService.showAll();
        for (User u:users) {
            System.out.println(u.getCol_Id()+u.getCol_Name());
        }

    }

}


